package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;

@Mapper
public interface UserMapper {
    /**
     * 根据Openid查询用户信息
     * @param openId
     * @return
     */
    @Select("select * from user where openid = #{oppenId}")
    User selectByOpenId(String openId);

    /**
     * 插入新用户
     * @param user
     */
    void insertUser(User user);

    @Select("select * from user where id = #{id}")
    User getById(Long userId);

    /**
     * 统计用户总量
     * @param map
     * @return
     */
    Integer userStatistics(HashMap<Object, Object> map);
}
